import os, sys
sys.stdout = sys.stderr
projectRoot = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..")

sys.path.insert(0, projectRoot)
os.environ['DJANGO_SETTINGS_MODULE'] = 'instafeed.settings'
print sys.path

import django.core.handlers.wsgi
from instafeed.wsgi_logging import LoggingMiddleware, LogRequestMiddleware

application = django.core.handlers.wsgi.WSGIHandler()
application = LoggingMiddleware(application)
#application = LogRequestMiddleware(application, '/tmp/wsgi_instafeed')
